package com.myapp.myhome.utils;

import java.util.HashSet;
import java.util.Set;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class MyPreferences {

	SharedPreferences preferences = null;
	Editor editor = null;

	public MyPreferences(Context context) {
		preferences = context.getSharedPreferences("Settings",
				Context.MODE_PRIVATE);
		editor = preferences.edit();
	}

	public String getString(String key) {
		return preferences.getString(key, "Nothing");
	}

	public void setString(String key, String str) {
		editor.putString(key, str);
		editor.commit();
	}

	public void setList(String key, Set<String> values) {
		editor.putStringSet(key, values);
		editor.commit();
	}

	public Set<String> getList(String key) {
		Set<String> siteno = new HashSet<String>();
		return preferences.getStringSet(key, siteno);
	}

}
